package com.yida.gwj.report.controller;

import com.yida.common.core.web.controller.BaseController;
import com.yida.common.core.web.page.TableDataInfo;
import com.yida.common.log.annotation.Log;
import com.yida.gwj.report.service.IGwjHomeNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author: PPV
 * @Date: 2023-03-03
 */

@RestController
@RequestMapping("/homeNotice")
@Api(tags = "首页通知")
public class GwjHomeNoticeController extends BaseController {

    @Resource
    private IGwjHomeNoticeService noticeService;

    @ApiOperation("查询待办")
    @GetMapping("/todo")
    @Log(title = "首页通知-查询代办", systemName = "gwj")
    public TableDataInfo getTodoList(@RequestParam(value = "areaId", required = false) Long areaId) {
        return noticeService.getTodoTable(areaId);
    }

    @ApiOperation("查询已办")
    @GetMapping("/done")
    @Log(title = "首页通知-查询已办", systemName = "gwj")
    public TableDataInfo getDoneList(@RequestParam(value = "areaId", required = false) Long areaId) {
        return noticeService.getDoneTable(areaId);
    }

    @ApiOperation("查询预警")
    @GetMapping("/warming")
    @Log(title = "首页通知-查询预警", systemName = "gwj")
    public TableDataInfo getWarmingList(@RequestParam(value = "areaId", required = false) Long areaId) {
        return noticeService.getWarmingTable(areaId);
    }

    @ApiOperation("查询未取件")
    @GetMapping("/uncollected")
    @Log(title = "首页通知-查询未取件", systemName = "gwj")
    public TableDataInfo getUnCollectedList(@RequestParam(value = "areaId", required = false) Long areaId) {
        return noticeService.getUnCollectedList(areaId);
    }

}
